exists

function <T> exists(arg: T?): boolean

Checks if a value is not null or empty.

An argument can be:

  1. Nullable type (T?) - checked for null.

  2. Collection (list, set, map) - checked for being empty (a nullable collection is also checked for null).

Special case: when used within a database at-expression, and the argument is also a database at-expression, it becomes a nested at-expression, which can use entities of the outer one. The call is translated into the SQL EXISTS clause with a nested SELECT.

Return

true if the value is not null and not an empty collection

Since

0.6.0

See also

empty(...)

empty(...)